/**
 * 
 */
package com.google.code.sip.ucenter.dao.mongo;

import java.util.List;

import com.google.code.sip.core.dao.mongo.GenericMongoDao;
import com.google.code.sip.ucenter.dao.CreditRuleDao;
import com.google.code.sip.ucenter.model.CreditRule;
import com.google.code.sip.ucenter.model.CreditType;

/**
 * @author Liuye
 * 
 */

public class CreditRuleDaoImpl extends GenericMongoDao<CreditRule, String>
		implements CreditRuleDao {
	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.google.code.sip.ucenter.dao.mongo.CreditRuleDao#getByAction(java.lang
	 * .String)
	 */
	public CreditRule getByAction(String action) {
		return getByProperty("action", action);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.google.code.sip.ucenter.dao.mongo.CreditRuleDao#findByCreditType(com.
	 * google.code.ucenter.model.CreditType)
	 */
	public List<CreditRule> findByCreditType(CreditType creditType) {
		List<CreditRule> creditRules = this.findByProperty(
				"creditRuleAmounts.creditType", creditType);
		return creditRules;
	}
}
